home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!olivea!oliveb!veritas!amdcad!sun!exodus!bea.lbl.gov
- From: envbvs@bea.lbl.gov (Brian V. Smith)
- Newsgroups: comp.sources.x
- Subject: v13i071: xfig2, Patch10, Part04/04
- Message-ID: <16334@exodus.Eng.Sun.COM>
- Date: 6 Jul 91 06:59:41 GMT
- References: <csx-13i068-xfig2.9@uunet.UU.NET>
- Sender: news@exodus.Eng.Sun.COM
- Lines: 1952
- Approved: argv@sun.com
-
- Submitted-by: envbvs@bea.lbl.gov (Brian V. Smith)
- Posting-number: Volume 13, Issue 71
- Archive-name: xfig2.9/patch10.04
- Patch-To: xfig2.9: Volume 8, Issue 10-30
- Patch-To: xfig2.9: Volume 10, Issue 26-31
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 4 (of 4)."
- # Contents: patch10.4
- # Wrapped by envbvs@bea.lbl.gov.lbl.gov on Fri Jun 14 14:37:06 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'patch10.4' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patch10.4'\"
- else
- echo shar: Extracting \"'patch10.4'\" \(53127 characters\)
- sed "s/^X//" >'patch10.4' <<'END_OF_FILE'
- X*** @xfig.pl9/save.c Mon Jun 25 11:25:47 1990
- X--- ./save.c Mon Jun 3 11:15:45 1991
- X***************
- X*** 17,30 ****
- X extern F_compound objects;
- X
- X extern int figure_modified;
- X! extern int errno;
- X!
- X extern null_proc();
- X
- X- extern char *sys_errlist[];
- X- extern int sys_nerr, errno;
- X- extern int num_object;
- X-
- X write_file(file_name, prompt)
- X char *file_name;
- X int prompt;
- X--- 17,25 ----
- X extern F_compound objects;
- X
- X extern int figure_modified;
- X! extern int num_object;
- X extern null_proc();
- X
- X write_file(file_name, prompt)
- X char *file_name;
- X int prompt;
- X***************
- X*** 71,83 ****
- X else {
- X figure_modified = 0;
- X num_object = 0;
- X! write_objects(fp);
- X put_msg("%d objects saved in \"%s\"", num_object, file_name);
- X return(0);
- X }
- X }
- X
- X! write_objects(fp)
- X FILE *fp;
- X {
- X extern char file_header[];
- X--- 66,82 ----
- X else {
- X figure_modified = 0;
- X num_object = 0;
- X! if (write_objects(fp))
- X! { put_msg("Error writing file %s, %s",file_name,
- X! sys_errlist[errno]);
- X! return(-1);
- X! }
- X put_msg("%d objects saved in \"%s\"", num_object, file_name);
- X return(0);
- X }
- X }
- X
- X! int write_objects(fp)
- X FILE *fp;
- X {
- X extern char file_header[];
- X***************
- X*** 118,124 ****
- X num_object++;
- X write_text(fp, t);
- X }
- X! fclose(fp);
- X }
- X
- X write_arc(fp, a)
- X--- 117,125 ----
- X num_object++;
- X write_text(fp, t);
- X }
- X! if (ferror(fp)) { fclose(fp); return(-1); }
- X! if (fclose(fp)==EOF) return(-1);
- X! return(0);
- X }
- X
- X write_arc(fp, a)
- X*** @xfig.pl9/search.c Tue Mar 6 09:09:23 1990
- X--- ./search.c Tue Jun 11 15:12:26 1991
- X***************
- X*** 10,16 ****
- X--- 10,588 ----
- X #include "fig.h"
- X #include "object.h"
- X
- X+ #define TOLERANCE 3
- X+
- X extern F_compound objects;
- X+
- X+ static (*manipulate)();
- X+ static (*handlerproc_left)();
- X+ static (*handlerproc_middle)();
- X+ static int type;
- X+ static char *p;
- X+ static char objectmarker_shown;
- X+ static long objectcount;
- X+ static long n;
- X+
- X+ static F_point point1, point2;
- X+
- X+ static F_arc *a;
- X+ static F_ellipse *e;
- X+ static F_line *l;
- X+ static F_spline *s;
- X+ static F_text *t;
- X+ static F_compound *c;
- X+
- X+ char next_arc_found(x, y, tolerance, px, py,shift)
- X+ int x, y, tolerance, *px, *py;
- X+ int shift;
- X+ { /* (px, py) is the control point on the circumference of an arc
- X+ which is the closest to (x, y) */
- X+
- X+ int i;
- X+
- X+ if (a==NULL)
- X+ a=objects.arcs;
- X+ else if (shift) a=a->next;
- X+
- X+ for (; a != NULL; a = a->next,n++) {
- X+ for (i = 0; i < 3; i++)
- X+ if ((abs(a->point[i].x - x) <= tolerance) &&
- X+ (abs(a->point[i].y - y) <= tolerance)) {
- X+ *px = a->point[i].x;
- X+ *py = a->point[i].y;
- X+ return(1);
- X+ }
- X+ }
- X+ return(0);
- X+ }
- X+
- X+
- X+ #define min(a,b) ((a) < (b) ? (a) : (b))
- X+
- X+ char next_ellipse_found(x, y, tolerance, px, py,shift)
- X+ int x, y, tolerance, *px, *py;
- X+ int shift;
- X+ { /* (px, py) is the point on the circumference of an ellipse
- X+ which is the closest to (x, y) */
- X+
- X+ int a, b, dx, dy;
- X+ float dis, r, tol;
- X+
- X+ if (e==NULL)
- X+ e=objects.ellipses;
- X+ else if (shift) e=e->next;
- X+
- X+ tol = (float) tolerance;
- X+ for (; e != NULL; e = e->next,n++) {
- X+ dx = x - e->center.x;
- X+ dy = y - e->center.y;
- X+ a = e->radiuses.x;
- X+ b = e->radiuses.y;
- X+ /* prevent sqrt(0) core dumps */
- X+ if(dx == 0 && dy == 0)
- X+ dis = 0; /* so we return below */
- X+ else
- X+ dis = sqrt((double)(dx*dx + dy*dy));
- X+ if (dis == 0) {
- X+ *px = e->center.x;
- X+ *py = e->center.y;
- X+ return(1);
- X+ }
- X+ if(a * dy == 0 && b * dx == 0)
- X+ r = 0; /* prevent core dumps */
- X+ else r = a * b * dis / sqrt((double) (1.0*b*b*dx*dx + 1.0*a*a*dy*dy));
- X+ if (fabs(dis - r) <= tol) {
- X+ *px = (int)(r*dx/dis + ((dx < 0) ? -.5 : .5)) + e->center.x;
- X+ *py = (int)(r*dy/dis + ((dy < 0) ? -.5 : .5)) + e->center.y;
- X+ return(1);
- X+ }
- X+ }
- X+ return(0);
- X+ }
- X+
- X+ char next_line_found(x, y, tolerance, px, py, shift)
- X+ int x, y, tolerance, *px, *py, shift;
- X+ { /*return the pointer to lines object if the search is successful
- X+ otherwise return NULL.
- X+ The value returned via (px, py) is the closest point on the
- X+ vector to point (x, y) */
- X+
- X+ F_line *lines;
- X+ F_point *point;
- X+ int x1, y1, x2, y2;
- X+ float tol2;
- X+
- X+ tol2 = (float) tolerance * tolerance;
- X+
- X+ if (l==NULL)
- X+ l=objects.lines;
- X+ else if (shift) l=l->next;
- X+
- X+ for (; l!= NULL; l= l->next,n++) {
- X+ point = l->points;
- X+ x1 = point->x;
- X+ y1 = point->y;
- X+ if (abs(x - x1) <= tolerance && abs(y - y1) <= tolerance) {
- X+ *px = x1; *py = y1;
- X+ return(1);
- X+ }
- X+ for (point = point->next; point != NULL; point = point->next) {
- X+ x2 = point->x;
- X+ y2 = point->y;
- X+ if (close_to_vector(x1, y1, x2, y2, x, y, tolerance, tol2,
- X+ px, py))
- X+ return(1);
- X+ x1 = x2;
- X+ y1 = y2;
- X+ }
- X+ }
- X+ return(0);
- X+ }
- X+
- X+ char next_spline_found(x, y, tolerance, px, py,shift)
- X+ int x, y, tolerance, *px, *py;
- X+ int shift;
- X+ { /* return the pointer to lines object if the search is successful
- X+ otherwise return NULL. */
- X+
- X+ F_point *point;
- X+ int x1, y1, x2, y2;
- X+ float tol2;
- X+
- X+ if (s==NULL)
- X+ s=objects.splines;
- X+ else if (shift) s=s->next;
- X+
- X+ tol2 = (float) tolerance * tolerance;
- X+ for (; s!= NULL; s= s->next,n++) {
- X+ point = s->points;
- X+ x1 = point->x;
- X+ y1 = point->y;
- X+ for (point = point->next; point != NULL; point = point->next) {
- X+ x2 = point->x;
- X+ y2 = point->y;
- X+ if (close_to_vector(x1, y1, x2, y2, x, y, tolerance, tol2,
- X+ px, py))
- X+ return(1);
- X+ x1 = x2;
- X+ y1 = y2;
- X+ }
- X+ }
- X+ return(0);
- X+ }
- X+
- X+ char next_text_found(x, y, dummy1, dummy2, dummy3, shift)
- X+ int x, y;
- X+ int dummy1, dummy2, dummy3, shift;
- X+ {
- X+ int halflen;
- X+
- X+ if (t==NULL)
- X+ t=objects.texts;
- X+ else if (shift) t=t->next;
- X+
- X+ for (; t != NULL; t = t->next,n++) {
- X+ halflen = t->length/2;
- X+ if (t->base_y - t->height > y)
- X+ continue;
- X+ if (t->base_y < y)
- X+ continue;
- X+ if ( ((t->type == T_LEFT_JUSTIFIED) && t->base_x > x) ||
- X+ ((t->type == T_CENTER_JUSTIFIED) && t->base_x - halflen > x) ||
- X+ ((t->type == T_RIGHT_JUSTIFIED) && t->base_x - t->length > x) )
- X+ continue;
- X+ if ( ((t->type == T_LEFT_JUSTIFIED) && t->base_x + t->length < x) ||
- X+ ((t->type == T_CENTER_JUSTIFIED) && t->base_x + halflen < x) ||
- X+ ((t->type == T_RIGHT_JUSTIFIED) && t->base_x < x) )
- X+ continue;
- X+ return(1);
- X+ }
- X+ return(0);
- X+ }
- X+
- X+ int next_compound_found(x, y, tolerance, px, py,shift)
- X+ int x, y, tolerance, *px, *py;
- X+ int shift;
- X+ {
- X+ float tol2;
- X+
- X+ if (c==NULL)
- X+ c=objects.compounds;
- X+ else if (shift) c=c->next;
- X+
- X+ tol2 = tolerance * tolerance;
- X+
- X+ for (; c != NULL; c = c->next,n++) {
- X+ if (close_to_vector(c->nwcorner.x, c->nwcorner.y, c->nwcorner.x,
- X+ c->secorner.y, x, y, tolerance, tol2, px, py))
- X+ return(1);
- X+ if (close_to_vector(c->secorner.x, c->secorner.y, c->nwcorner.x,
- X+ c->secorner.y, x, y, tolerance, tol2, px, py))
- X+ return(1);
- X+ if (close_to_vector(c->secorner.x, c->secorner.y, c->secorner.x,
- X+ c->nwcorner.y, x, y, tolerance, tol2, px, py))
- X+ return(1);
- X+ if (close_to_vector(c->nwcorner.x, c->nwcorner.y, c->secorner.x,
- X+ c->nwcorner.y, x, y, tolerance, tol2, px, py))
- X+ return(1);
- X+ }
- X+ return(0);
- X+ }
- X+
- X+ show_objectmarker()
- X+ {
- X+ if (objectmarker_shown) return;
- X+ objectmarker_shown=1;
- X+ erase_pointmarker();
- X+ toggle_objectmarker();
- X+ }
- X+
- X+ erase_objectmarker()
- X+ {
- X+ if (!objectmarker_shown) return;
- X+ objectmarker_shown=0;
- X+ erase_pointmarker();
- X+ toggle_objectmarker();
- X+ }
- X+
- X+ finish_objectmarker()
- X+ {
- X+ show_pointmarker();
- X+ if (!objectmarker_shown) return;
- X+ objectmarker_shown=0;
- X+ toggle_objectmarker();
- X+ }
- X+
- X+ toggle_objectmarker()
- X+ {
- X+ switch(type)
- X+ { case O_ELLIPSE: toggle_ellipsepointmarker(e);
- X+ break;
- X+ case O_POLYLINE: toggle_linepointmarker(l);
- X+ break;
- X+ case O_SPLINE: toggle_splinepointmarker(s);
- X+ break;
- X+ case O_TEXT: toggle_textpointmarker(t);
- X+ break;
- X+ case O_ARC: toggle_arcpointmarker(a);
- X+ break;
- X+ case O_COMPOUND: toggle_compoundpointmarker(c);
- X+ break;
- X+ }
- X+ }
- X+
- X+ void init_object_search(handlerproc)
- X+ int (*handlerproc)();
- X+ {
- X+ objectcount=0;
- X+ for (e=objects.ellipses;e!=NULL;e=e->next) objectcount++;
- X+ for (l=objects.lines;l!=NULL;l=l->next) objectcount++;
- X+ for (s=objects.splines;s!=NULL;s=s->next) objectcount++;
- X+ for (t=objects.texts;t!=NULL;t=t->next) objectcount++;
- X+ for (a=objects.arcs;a!=NULL;a=a->next) objectcount++;
- X+ for (c=objects.compounds;c!=NULL;c=c->next) objectcount++;
- X+ e=NULL;
- X+ type=O_ELLIPSE;
- X+ manipulate=handlerproc;
- X+ objectmarker_shown=0;
- X+ }
- X+
- X+ void object_search(x,y,shift)
- X+ int x, y;
- X+ unsigned int shift; /* Shift Key Status from XEvent */
- X+ {
- X+ int px,py;
- X+ char found=0;
- X+ erase_objectmarker();
- X+ for (n=0;n<objectcount;)
- X+ {
- X+ switch(type)
- X+ { case O_ELLIPSE: if (next_ellipse_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ case O_POLYLINE: if (next_line_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ case O_SPLINE: if (next_spline_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ case O_TEXT: if (next_text_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ case O_ARC: if (next_arc_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ case O_COMPOUND: if (next_compound_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ }
- X+ if (found)
- X+ { if (! shift) break;
- X+ show_objectmarker();
- X+ found=0;
- X+ break;
- X+ }
- X+ switch(type)
- X+ { case O_ELLIPSE: type=O_POLYLINE;
- X+ l=NULL;
- X+ break;
- X+ case O_POLYLINE: type=O_SPLINE;
- X+ s=NULL;
- X+ break;
- X+ case O_SPLINE: type=O_TEXT;
- X+ t=NULL;
- X+ break;
- X+ case O_TEXT: type=O_ARC;
- X+ a=NULL;
- X+ break;
- X+ case O_ARC: type=O_COMPOUND;
- X+ c=NULL;
- X+ break;
- X+ case O_COMPOUND: type=O_ELLIPSE;
- X+ e=NULL;
- X+ break;
- X+ }
- X+ }
- X+ if (found)
- X+ { finish_objectmarker();
- X+ switch(type)
- X+ { case O_ELLIPSE: manipulate(e,type,x,y,px,py);
- X+ break;
- X+ case O_POLYLINE: manipulate(l,type,x,y,px,py);
- X+ break;
- X+ case O_SPLINE: manipulate(s,type,x,y,px,py);
- X+ break;
- X+ case O_TEXT: manipulate(t,type,x,y,px,py);
- X+ break;
- X+ case O_ARC: manipulate(a,type,x,y,px,py);
- X+ break;
- X+ case O_COMPOUND: manipulate(c,type,x,y,px,py);
- X+ break;
- X+ }
- X+ /* On next invocation, start searching from the start */
- X+ e=NULL;
- X+ type=O_ELLIPSE;
- X+ }
- X+ }
- X+
- X+
- X+
- X+
- X+
- X+ char next_ellipse_point_found(x, y, tol, point_num, shift )
- X+ int x, y, tol, shift, *point_num;
- X+ {
- X+
- X+ if (e==NULL)
- X+ e=objects.ellipses;
- X+ else if (shift) e=e->next;
- X+
- X+
- X+ for (; e != NULL; e = e->next,n++) {
- X+ if (abs(e->start.x - x) <= tol && abs(e->start.y - y) <= tol) {
- X+ *point_num = 0;
- X+ return(1);
- X+ }
- X+ if (abs(e->end.x - x) <= tol && abs(e->end.y - y) <= tol) {
- X+ *point_num = 1;
- X+ return(1);
- X+ }
- X+ }
- X+ return(0);
- X+ }
- X+
- X+
- X+ static F_arc *cur_a;
- X+
- X+ char next_arc_point_found(x, y, tol, point_num, shift)
- X+ int x, y, tol, shift, *point_num;
- X+ {
- X+ int i;
- X+
- X+ if (a==NULL)
- X+ a=objects.arcs;
- X+ else if (shift) a=a->next;
- X+
- X+ for(; a != NULL; a = a->next,n++) {
- X+ for (i = 0; i < 3; i++) {
- X+ if (abs(a->point[i].x - x) <= tol &&
- X+ abs(a->point[i].y - y) <= tol) {
- X+ *point_num = i;
- X+ return(1);
- X+ }
- X+ }
- X+ }
- X+ return(0);
- X+ }
- X+
- X+ char next_spline_point_found(x, y, tol, p, q, shift)
- X+ int x, y, tol, shift;
- X+ F_point **p, **q;
- X+ {
- X+ if (s==NULL)
- X+ s=objects.splines;
- X+ else if (shift) s=s->next;
- X+
- X+ for (; s != NULL; s= s->next,n++) {
- X+ *p = NULL;
- X+ for (*q = s->points; *q != NULL; *p = *q, *q = (*q)->next) {
- X+ if (abs((*q)->x - x) <= tol && abs((*q)->y - y) <= tol)
- X+ return(1);
- X+ }
- X+ }
- X+ return(0);
- X+ }
- X+
- X+ char next_line_point_found(x, y, tol, p, q, shift)
- X+ int x, y, tol, shift;
- X+ F_point **p, **q;
- X+ {
- X+ F_point *a, *b;
- X+
- X+ if (l==NULL)
- X+ l=objects.lines;
- X+ else if (shift) l=l->next;
- X+
- X+ for (; l != NULL; l= l->next,n++) {
- X+ for (a = NULL, b = l->points; b != NULL; a = b, b = b->next) {
- X+ if (abs(b->x - x) <= tol && abs(b->y - y) <= tol) {
- X+ *p = a;
- X+ *q = b;
- X+ return(1);
- X+ }
- X+ }
- X+ }
- X+ return(0);
- X+ }
- X+
- X+ void init_point_search(handlerproc)
- X+ int (*handlerproc)();
- X+ {
- X+ objectcount=0;
- X+ for (e=objects.ellipses;e!=NULL;e=e->next) objectcount++;
- X+ for (l=objects.lines;l!=NULL;l=l->next) objectcount++;
- X+ for (s=objects.splines;s!=NULL;s=s->next) objectcount++;
- X+ for (t=objects.texts;t!=NULL;t=t->next) objectcount++;
- X+ for (a=objects.arcs;a!=NULL;a=a->next) objectcount++;
- X+ for (c=objects.compounds;c!=NULL;c=c->next) objectcount++;
- X+ e=NULL;
- X+ type=O_ELLIPSE;
- X+ handlerproc_left=handlerproc;
- X+ objectmarker_shown=0;
- X+ }
- X+
- X+ void init_point_search_middle(handlerproc)
- X+ int (*handlerproc)();
- X+ {
- X+ objectcount=0;
- X+ for (e=objects.ellipses;e!=NULL;e=e->next) objectcount++;
- X+ for (l=objects.lines;l!=NULL;l=l->next) objectcount++;
- X+ for (s=objects.splines;s!=NULL;s=s->next) objectcount++;
- X+ for (t=objects.texts;t!=NULL;t=t->next) objectcount++;
- X+ for (a=objects.arcs;a!=NULL;a=a->next) objectcount++;
- X+ for (c=objects.compounds;c!=NULL;c=c->next) objectcount++;
- X+ e=NULL;
- X+ type=O_ELLIPSE;
- X+ handlerproc_middle=handlerproc;
- X+ objectmarker_shown=0;
- X+ }
- X+
- X+ void do_point_search(x,y,shift)
- X+ int x, y;
- X+ unsigned int shift; /* Shift Key Status from XEvent */
- X+ {
- X+ F_point *px,*py;
- X+ char found=0;
- X+ px= &point1;
- X+ py= &point2;
- X+ erase_objectmarker();
- X+ for (n=0;n<objectcount;)
- X+ {
- X+ switch(type)
- X+ { case O_ELLIPSE: if (next_ellipse_point_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ case O_POLYLINE: if (next_line_point_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ case O_SPLINE: if (next_spline_point_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ case O_ARC: if (next_arc_point_found(x,y,TOLERANCE,&px,&py,shift))
- X+ { found=1;
- X+ }
- X+ break;
- X+ }
- X+ if (found)
- X+ { if (! shift) break;
- X+ show_objectmarker();
- X+ found=0;
- X+ break;
- X+ }
- X+ switch(type)
- X+ { case O_ELLIPSE: type=O_POLYLINE;
- X+ l=NULL;
- X+ break;
- X+ case O_POLYLINE: type=O_SPLINE;
- X+ s=NULL;
- X+ break;
- X+ case O_SPLINE: type=O_ARC;
- X+ a=NULL;
- X+ break;
- X+ case O_ARC: type=O_ELLIPSE;
- X+ e=NULL;
- X+ break;
- X+ }
- X+ }
- X+ if (found)
- X+ { finish_objectmarker();
- X+ switch(type)
- X+ { case O_ELLIPSE: manipulate(e,type,x,y,px,py);
- X+ break;
- X+ case O_POLYLINE: manipulate(l,type,x,y,px,py);
- X+ break;
- X+ case O_SPLINE: manipulate(s,type,x,y,px,py);
- X+ break;
- X+ case O_ARC: manipulate(a,type,x,y,px,py);
- X+ break;
- X+ }
- X+ /* On next invocation, start searching from the start */
- X+ e=NULL;
- X+ type=O_ELLIPSE;
- X+ }
- X+ }
- X+
- X+
- X+ void point_search(x,y,shift)
- X+ int x, y;
- X+ unsigned int shift; /* Shift Key Status from XEvent */
- X+ {
- X+ manipulate=handlerproc_left;
- X+ do_point_search(x,y,shift);
- X+ }
- X+
- X+ void point_search_middle(x,y,shift)
- X+ int x, y;
- X+ unsigned int shift; /* Shift Key Status from XEvent */
- X+ {
- X+ manipulate=handlerproc_middle;
- X+ do_point_search(x,y,shift);
- X+ }
- X+
- X+ /* =============================================================== */
- X+
- X+ /* These are the original search subroutines.
- X+ They are still used by some functions.
- X+ */
- X
- X F_arc *
- X arc_search(x, y, tolerance, px, py)
- X*** @xfig.pl9/spline.c Thu Jul 5 13:23:57 1990
- X--- ./spline.c Mon Jun 3 11:16:08 1991
- X***************
- X*** 70,76 ****
- X draw_elasticline();
- X if (num_point <= 2) {
- X pw_vector(canvas_win, first_point->x, first_point->y,
- X! cur_point->x, cur_point->y, PAINT, 1, SOLID_LINE, 0.0);
- X if (num_point == 1) {
- X free((char*)cur_point);
- X cur_point = NULL;
- X--- 70,76 ----
- X draw_elasticline();
- X if (num_point <= 2) {
- X pw_vector(canvas_win, first_point->x, first_point->y,
- X! cur_point->x, cur_point->y, PAINT, 1, RUBBER_LINE, 0.0);
- X if (num_point == 1) {
- X free((char*)cur_point);
- X cur_point = NULL;
- X***************
- X*** 86,92 ****
- X }
- X spline->style = line_style;
- X spline->thickness = line_thickness;
- X! spline->style_val = cur_styleval;
- X spline->color = cur_color;
- X spline->depth = 0;
- X spline->pen = 0;
- X--- 86,92 ----
- X }
- X spline->style = line_style;
- X spline->thickness = line_thickness;
- X! spline->style_val = cur_styleval*(line_thickness+1)/2;
- X spline->color = cur_color;
- X spline->depth = 0;
- X spline->pen = 0;
- X***************
- X*** 122,127 ****
- X--- 122,128 ----
- X else
- X spline->back_arrow = NULL;
- X spline->type = T_OPEN_NORMAL;
- X+ spline->area_fill = fill_mode? cur_areafill : 0;
- X draw_open_spline(spline, PAINT);
- X }
- X if (appres.DEBUG) {
- X*** @xfig.pl9/text.c Wed Aug 1 15:56:29 1990
- X--- ./text.c Wed Jun 12 09:01:51 1991
- X***************
- X*** 117,123 ****
- X }
- X draw_text(cur_text, PAINT);
- X clean_up();
- X! set_action_object(F_TEXT, O_TEXT);
- X set_latesttext(cur_text);
- X set_modifiedflag();
- X }
- X--- 117,123 ----
- X }
- X draw_text(cur_text, PAINT);
- X clean_up();
- X! set_action_object(F_CREATE, O_TEXT);
- X set_latesttext(cur_text);
- X set_modifiedflag();
- X }
- X***************
- X*** 154,159 ****
- X--- 154,161 ----
- X base_y = cur_y;
- X }
- X else { /* clicked on existing text */
- X+ /* must finish with left button */
- X+ /* canvas_middlebut_proc = null_proc; */
- X /* leng_prefix is # of char in the text before the cursor */
- X leng_suffix = strlen(cur_text->cstring);
- X basx = cur_text->base_x;
- X***************
- X*** 283,291 ****
- X {
- X size = pf_textwidth(text->font,text->size,strlen(text->cstring),text->cstring);
- X if (text->type == T_CENTER_JUSTIFIED)
- X! x -= size.x/2;
- X else
- X! x -= size.x;
- X }
- X pw_text(canvas_win, x, text->base_y,
- X op, text->font, text->size, text->cstring);
- X--- 285,293 ----
- X {
- X size = pf_textwidth(text->font,text->size,strlen(text->cstring),text->cstring);
- X if (text->type == T_CENTER_JUSTIFIED)
- X! x -= size.x/2/zoomscale;
- X else
- X! x -= size.x/zoomscale;
- X }
- X pw_text(canvas_win, x, text->base_y,
- X op, text->font, text->size, text->cstring);
- X*** @xfig.pl9/turn.c Mon Apr 30 12:13:55 1990
- X--- ./turn.c Mon Jun 3 11:16:15 1991
- X***************
- X*** 14,21 ****
- X #include "object.h"
- X #include "paintop.h"
- X
- X- #define TOLERANCE 7
- X-
- X extern (*canvas_kbd_proc)();
- X extern (*canvas_locmove_proc)();
- X extern (*canvas_leftbut_proc)();
- X--- 14,19 ----
- X***************
- X*** 31,64 ****
- X extern F_spline *spline_search();
- X
- X extern int init_turn();
- X
- X turn_selected()
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! canvas_leftbut_proc = init_turn;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick15_cursor);
- X }
- X
- X! init_turn(x, y)
- X int x, y;
- X {
- X F_line *l;
- X F_spline *s;
- X- int dummy;
- X
- X! if ((l = line_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
- X if (l->type == T_BOX || l->type == T_ARC_BOX) return;
- X line_2_spline(l);
- X turn_selected();
- X! }
- X! else if ((s = spline_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
- X spline_2_line(s);
- X turn_selected();
- X! }
- X }
- X
- X line_2_spline(l)
- X F_line *l;
- X--- 29,73 ----
- X extern F_spline *spline_search();
- X
- X extern int init_turn();
- X+ extern init_object_search();
- X+ extern object_search();
- X
- X+
- X turn_selected()
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! init_object_search(init_turn);
- X! canvas_leftbut_proc = object_search;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick15_cursor);
- X }
- X
- X! init_turn(p,type,x, y,px,py)
- X! char *p;
- X! int type;
- X int x, y;
- X+ int px,py;
- X {
- X F_line *l;
- X F_spline *s;
- X
- X! switch(type)
- X! { case O_POLYLINE:
- X! l=(F_line *) p;
- X if (l->type == T_BOX || l->type == T_ARC_BOX) return;
- X line_2_spline(l);
- X turn_selected();
- X! break;
- X! case O_SPLINE:
- X! s=(F_spline *) p;
- X spline_2_line(s);
- X turn_selected();
- X! break;
- X! default: return;
- X }
- X+ }
- X
- X line_2_spline(l)
- X F_line *l;
- X*** @xfig.pl9/undo.c Tue Apr 17 16:35:19 1990
- X--- ./undo.c Mon Jun 3 10:56:11 1991
- X***************
- X*** 316,322 ****
- X toggle_ellipsepointmarker(saved_objects.ellipses);
- X break;
- X case O_TEXT :
- X! draw_text(saved_objects.texts, INV_PAINT);
- X translate_text(saved_objects.texts, dx, dy);
- X draw_text(saved_objects.texts, PAINT);
- X break;
- X--- 316,322 ----
- X toggle_ellipsepointmarker(saved_objects.ellipses);
- X break;
- X case O_TEXT :
- X! draw_text(saved_objects.texts, ERASE);
- X translate_text(saved_objects.texts, dx, dy);
- X draw_text(saved_objects.texts, PAINT);
- X break;
- X*** @xfig.pl9/util.c Mon Apr 16 11:26:25 1990
- X--- ./util.c Mon Jun 3 11:16:19 1991
- X***************
- X*** 143,148 ****
- X--- 143,149 ----
- X F_arc *a;
- X F_line *l;
- X F_spline *s;
- X+ F_text *t;
- X
- X for (e = objects.ellipses; e != NULL; e = e->next) {
- X toggle_ellipsepointmarker(e);
- X***************
- X*** 156,161 ****
- X--- 157,165 ----
- X for (s = objects.splines; s != NULL; s = s->next) {
- X toggle_splinepointmarker(s);
- X }
- X+ for (t = objects.texts; t != NULL; t = t->next) {
- X+ toggle_textpointmarker(t);
- X+ }
- X }
- X
- X toggle_ellipsepointmarker(e)
- X***************
- X*** 175,180 ****
- X--- 179,191 ----
- X set_marker(canvas_win, a->point[1].x-2, a->point[1].y-2, 5, 5,
- X INV_PAINT, &pmarker, 0, 0);
- X set_marker(canvas_win, a->point[2].x-2, a->point[2].y-2, 5, 5,
- X+ INV_PAINT, &pmarker, 0, 0);
- X+ }
- X+
- X+ toggle_textpointmarker(t)
- X+ F_text *t;
- X+ {
- X+ set_marker(canvas_win, t->base_x-2, t->base_y-2, 5, 5,
- X INV_PAINT, &pmarker, 0, 0);
- X }
- X
- X*** @xfig.pl9/xfig.man Fri Sep 21 14:36:17 1990
- X--- ./xfig.man Tue Jun 11 17:06:13 1991
- X***************
- X*** 18,23 ****
- X--- 18,24 ----
- X [\fIfile\fP]
- X [\fB-normal[Font]\fP \fIfont\fP]
- X [\fB-bold[Font]\fP \fIfont\fP]
- X+ [\fB-startfontsize \fIpointsize\fP]
- X .SH DESCRIPTION
- X .I Xfig
- X is a menu-driven tool that allows the user to draw and manipulate objects
- X***************
- X*** 107,113 ****
- X \fB-tr\fP
- X Turn on cursor (mouse) tracking arrows.
- X .TP
- X! \fB-no\fP
- X Turn off cursor (mouse) tracking arrows.
- X .TP
- X \fB-inc\fP
- X--- 108,114 ----
- X \fB-tr\fP
- X Turn on cursor (mouse) tracking arrows.
- X .TP
- X! \fB-not\fP
- X Turn off cursor (mouse) tracking arrows.
- X .TP
- X \fB-inc\fP
- X***************
- X*** 129,134 ****
- X--- 130,138 ----
- X .TP
- X \fB-bold\fP \fIfont\fP
- X Cause the font used for displaying messages to be \fIfont\fP.
- X+ .TP
- X+ \fB-startfontsize\fP \fIpointsize\fP
- X+ Set the default font size for text objects.
- X .SH "GRAPHICAL OBJECTS"
- X The objects in \fIxfig\fP are divided into \fBprimitive objects\fP and
- X \fBcompound object\fP. The primitive objects are: \fIARC\fP, \fICIRCLE\fP,
- X***************
- X*** 338,343 ****
- X--- 342,352 ----
- X Press the "apply" button to apply the changes but keep the menu up for
- X further changes. Press the "cancel" button to cancel the changes and
- X pop down the menu.
- X+
- X+ The depth parameter of objects can only be changed using this tool.
- X+ It defines how overlapping objects are displayed. Objects with
- X+ a greater depth value are obstructed by objects with smaller depth
- X+ value.
- X .TP
- X .I CIRCLE
- X Create circles by specifying their radii or diameters.
- X***************
- X*** 507,513 ****
- X .TP
- X .I SOLID/DASHED/DOTTED LINE STYLE
- X Toggle between solid, dashed and dotted line styles. The dash length
- X! is fixed at 0.05 inch.
- X .SH X DEFAULTS
- X The overall widget name(Class) is xfig.fig(Fig.TopLevelShell). This
- X set of resources correspond to the command line arguments:
- X--- 516,564 ----
- X .TP
- X .I SOLID/DASHED/DOTTED LINE STYLE
- X Toggle between solid, dashed and dotted line styles. The dash length
- X! defaults to 0.05 inch * line width and can be changed using the
- X! Change menu.
- X! .SH "SELECTING OBJECTS"
- X! When multiple objects have points in common, e.g. two boxes that
- X! touch at one corner, only one object can be selected by clicking on
- X! that point. To select other objects, hold down the shift key while
- X! pressing the left mouse button: the markers of all objects but one will
- X! vanish. By repeatedly clicking the left button while holding down
- X! the shift key, it is possible to cycle through all candidates for
- X! selection at that point. To perform the selected action, e.g.
- X! deleting one box, click on the point without holding down the
- X! shift key.
- X!
- X! This selection mechanism works for the following actions:
- X! remove object, move object, copy object, add point, move point,
- X! delete point, add/remove arrowhead, change object, switch object
- X! polyline/spline.
- X! .SH "ZOOMING/PANNING"
- X! .TP
- X! .I ZOOMING
- X! If Zooming is selected, a zoom box can be defined by pressing the
- X! left mouse button on one corner and the middle mouse button on the
- X! opposite one.
- X! The integer zoom scale is displayed within the zoom button. Ruler,
- X! grid and linewidth are scaled, too. Text objects can not be enlarged
- X! and are therefore always displayed in their real point size.
- X! The figure is unzoomed (i.e. the zoom scale is decreased by 1)
- X! by pressing the middle mouse button in the
- X! drawing area.
- X!
- X! To reset the zoom scale to 1, click on the zoom button with the right
- X! mouse button.
- X! .TP
- X! .I PANNING
- X! With panning selected, click with the left button on the drawing area
- X! to define the new upper left corner of the displayed region; use the
- X! middle button
- X! to define its new center. The displayed region
- X! is adjusted such that no negative coordinates are visible. The displayed
- X! region can be panned at any time using the arrow keys.
- X!
- X! Clicking the zoom button with the right button resets the pan window
- X! to the upper left corner of the coordinate space.
- X .SH X DEFAULTS
- X The overall widget name(Class) is xfig.fig(Fig.TopLevelShell). This
- X set of resources correspond to the command line arguments:
- X***************
- X*** 541,546 ****
- X--- 592,600 ----
- X .TP
- X boldFont
- X (string:8x13bold) -bold argument
- X+ .TP
- X+ startfontsize
- X+ (integer:12) -startfontsize argument
- X .PP
- X These arguments correspond to the widgets which make up \fIxfig\fP.
- X .TP 1.5i
- X***************
- X*** 599,616 ****
- X \f(CWxfig*form.indicator.background: blue\fP
- X .SH BUGS
- X .PP
- X- Creating a text object is not "Undoable".
- X- .PP
- X Area fill doesn't show on the canvas for closed splines, but are filled
- X when printed. This has to do with the way the splines are generated on the
- X screen.
- X .PP
- X! Undoing the creation of a compound object deletes the objects
- X! outside the compound object. Undoing the undo doesn't bring them back.
- X .PP
- X Undoing a move-point of a box or arc-box will corrupt the object.
- X .PP
- X Ellipses which are too narrow are not drawn correctly.
- X .SH "SEE ALSO"
- X Brian W. Kernighan
- X .I "PIC - A Graphics Language for Typesetting User Manual"
- X--- 653,682 ----
- X \f(CWxfig*form.indicator.background: blue\fP
- X .SH BUGS
- X .PP
- X Area fill doesn't show on the canvas for closed splines, but are filled
- X when printed. This has to do with the way the splines are generated on the
- X screen.
- X .PP
- X! Undo of creation of compound object is disabled due to a bug that
- X! deleted objects OUTSIDE of the compound.
- X .PP
- X Undoing a move-point of a box or arc-box will corrupt the object.
- X .PP
- X Ellipses which are too narrow are not drawn correctly.
- X+ .PP
- X+ Generating a closed interpolated spline by clicking with the middle
- X+ mouse button on the starting point of the spline results in a core
- X+ dump
- X+ .PP
- X+ Drawing an ellipse specifying diameters with height 0, then
- X+ applying the change menu and clicking on the done button leads to a
- X+ core dump
- X+ .PP
- X+ There are two redraws after starting xfig and when changing the grid.
- X+ Annoying on slow terminals
- X+ .PP
- X+ When an arrow key is pressed while drawing e.g. a line, the picture
- X+ is distorted by the panning operation
- X .SH "SEE ALSO"
- X Brian W. Kernighan
- X .I "PIC - A Graphics Language for Typesetting User Manual"
- X***************
- X*** 688,690 ****
- X--- 754,766 ----
- X Frank Schmuck
- X .br
- X (schmuck@svax.cs.cornell.edu)
- X+ .sp
- X+ Zooming and panning functions, shift key select mechanism by:
- X+ .br
- X+ Dieter Pellkofer
- X+ (dip@regent.e-technik.tu-muenchen.de)
- X+ .br
- X+ and
- X+ .br
- X+ Henning Spruth
- X+ (hns@regent.e-technik.tu-muenchen.de)
- X*** /dev/null Fri Jun 14 10:34:50 1991
- X--- zoom.h Thu May 16 05:02:28 1991
- X***************
- X*** 0 ****
- X--- 1,42 ----
- X+ #ifndef ZOOMDEF
- X+ extern long zoomscale;
- X+ extern long zoomxoff;
- X+ extern long zoomyoff;
- X+
- X+ #define ZOOMX(x) (zoomscale*(x-zoomxoff))
- X+ #define ZOOMY(y) (zoomscale*(y-zoomyoff))
- X+ #define BACKX(x) ((int) x/(float)zoomscale+zoomxoff+0.5)
- X+ #define BACKY(y) ((int) y/(float)zoomscale+zoomyoff+0.5)
- X+
- X+ #define ZOOMSTEP 50
- X+
- X+ #define zXDrawPoint(d,w,gc,x,y) XDrawPoint(d,w,gc,ZOOMX(x),ZOOMY(y))
- X+ #define zXDrawArc(d,w,gc,x,y,d1,d2,a1,a2)\
- X+ XDrawArc(d,w,gc,ZOOMX(x),ZOOMY(y),zoomscale*(d1),zoomscale*(d2),\
- X+ a1,a2)
- X+ #define zXFillArc(d,w,gc,x,y,d1,d2,a1,a2)\
- X+ XFillArc(d,w,gc,ZOOMX(x),ZOOMY(y),zoomscale*(d1),zoomscale*(d2),\
- X+ a1,a2)
- X+ #define zXDrawLine(d,w,gc,x1,y1,x2,y2)\
- X+ XDrawLine(d,w,gc,ZOOMX(x1),ZOOMY(y1),ZOOMX(x2),ZOOMY(y2))
- X+ #define zXDrawString(d,w,gc,x,y,s,l)\
- X+ XDrawString(d,w,gc,ZOOMX(x),ZOOMY(y),s,l)
- X+ #define zXFillRectangle(d,w,gc,x1,y1,x2,y2)\
- X+ XFillRectangle(d,w,gc,ZOOMX(x1),ZOOMY(y1),zoomscale*(x2),zoomscale*(y2))
- X+ #define zXDrawRectangle(d,w,gc,x1,y1,x2,y2)\
- X+ XDrawRectangle(d,w,gc,ZOOMX(x1),ZOOMY(y1),zoomscale*(x2),zoomscale*(y2))
- X+ #define zXDrawLines(d,w,gc,p,n,m)\
- X+ {int i;\
- X+ for(i=0;i<n;i++){p[i].x=ZOOMX(p[i].x);p[i].y=ZOOMY(p[i].y);}\
- X+ XDrawLines(d,w,gc,p,n,m);\
- X+ for(i=0;i<n;i++){p[i].x=BACKX(p[i].x);p[i].y=BACKY(p[i].y);}\
- X+ }
- X+
- X+ #define zXFillPolygon(d,w,gc,p,n,m,o)\
- X+ {int i;\
- X+ for(i=0;i<n;i++){p[i].x=ZOOMX(p[i].x);p[i].y=ZOOMY(p[i].y);}\
- X+ XFillPolygon(d,w,gc,p,n,m,o);\
- X+ for(i=0;i<n;i++){p[i].x=BACKX(p[i].x);p[i].y=BACKY(p[i].y);}\
- X+ }
- X+ #define ZOOMDEF
- X+ #endif
- X*** /dev/null Fri Jun 14 10:34:50 1991
- X--- zoom.c Thu Jun 13 08:32:20 1991
- X***************
- X*** 0 ****
- X--- 1,117 ----
- X+ /*
- X+ * FIG : Facility for Interactive Generation of figures
- X+ *
- X+ * Copyright (c) 1991 by Henning Spruth
- X+ * (hns@regent.e-technik.tu-muenchen.de)
- X+ * May 1991
- X+ *
- X+ * %W% %G%
- X+ *
- X+ */
- X+
- X+ #include "fig.h"
- X+ #include "resources.h"
- X+ #include "alloc.h"
- X+ #include "func.h"
- X+ #include "object.h"
- X+ #include "paintop.h"
- X+ #include "zoom.h"
- X+
- X+ extern (*canvas_kbd_proc)();
- X+ extern (*canvas_locmove_proc)();
- X+ extern (*canvas_leftbut_proc)();
- X+ extern (*canvas_middlebut_proc)();
- X+ extern (*canvas_rightbut_proc)();
- X+
- X+ extern null_proc();
- X+ extern set_popupmenu();
- X+ extern int CANVAS_WIDTH, CANVAS_HEIGHT;
- X+ extern int fix_x, fix_y, cur_x, cur_y;
- X+
- X+ static do_zoom();
- X+ static zoom_up();
- X+ static init_zoombox_drawing();
- X+ extern elastic_box();
- X+ extern int gc_thickness[NUMOPS];
- X+
- X+ long zoomscale=1;
- X+ long zoomxoff=0;
- X+ long zoomyoff=0;
- X+
- X+ zoom_canvas_selected()
- X+ {
- X+ canvas_kbd_proc = null_proc;
- X+ canvas_locmove_proc = null_proc;
- X+ canvas_leftbut_proc = init_zoombox_drawing;
- X+ canvas_middlebut_proc = zoom_up;
- X+ canvas_rightbut_proc = set_popupmenu;
- X+ set_cursor(&arrow_cursor);
- X+ reset_action_on();
- X+ }
- X+
- X+ static init_zoombox_drawing(x, y)
- X+ int x, y;
- X+ {
- X+ cur_x = fix_x = x;
- X+ cur_y = fix_y = y;
- X+ canvas_locmove_proc = elastic_box;
- X+ canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
- X+ canvas_middlebut_proc = do_zoom;
- X+ draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
- X+ set_temp_cursor(&null_cursor);
- X+ set_action_on();
- X+ }
- X+
- X+ static do_zoom(x,y)
- X+ int x,y;
- X+ {
- X+ int dimx,dimy;
- X+ int t; /* loop counter */
- X+ float scalex,scaley;
- X+ draw_rectbox(fix_x, fix_y, cur_x, cur_y, INV_PAINT);
- X+ zoomxoff= fix_x<x ? fix_x : x;
- X+ zoomyoff= fix_y<y ? fix_y : y;
- X+ dimx=abs(x-fix_x);
- X+ dimy=abs(y-fix_y);
- X+ if (zoomxoff<0) zoomxoff=0;
- X+ if (zoomyoff<0) zoomyoff=0;
- X+ if (dimx && dimy)
- X+ { scalex=CANVAS_WIDTH/(float) dimx;
- X+ scaley=CANVAS_HEIGHT/(float) dimy;
- X+ zoomscale= (int) scalex>scaley ? scaley : scalex;
- X+ if (zoomscale>9) zoomscale=9;
- X+ show_zoomscale();
- X+ for (t=0;t<NUMOPS;t++) gc_thickness[t]= -1;
- X+ setup_rulers();
- X+ redisplay_rulers();
- X+ setup_grid(0);
- X+ }
- X+ zoom_canvas_selected();
- X+ }
- X+
- X+ static zoom_up()
- X+ {
- X+ int t; /* loop counter */
- X+ if (zoomscale>1)
- X+ { zoomscale--;
- X+ show_zoomscale();
- X+ for (t=0;t<NUMOPS;t++) gc_thickness[t]= -1;
- X+ setup_rulers();
- X+ redisplay_rulers();
- X+ setup_grid(0);
- X+ }
- X+ zoom_canvas_selected();
- X+ }
- X+
- X+ zoom_scale_1()
- X+ {
- X+ int t; /* loop counter */
- X+ zoomscale=1;
- X+ zoomxoff=0;
- X+ zoomyoff=0;
- X+ show_zoomscale();
- X+ setup_rulers();
- X+ for (t=0;t<NUMOPS;t++) gc_thickness[t]= -1;
- X+ redisplay_rulers();
- X+ setup_grid(0);
- X+ }
- X*** /dev/null Fri Jun 14 10:34:50 1991
- X--- pan.c Thu Jun 13 08:32:08 1991
- X***************
- X*** 0 ****
- X--- 1,86 ----
- X+ /*
- X+ * FIG : Facility for Interactive Generation of figures
- X+ *
- X+ * Copyright (c) 1991 by Henning Spruth
- X+ * (hns@regent.e-technik.tu-muenchen.de)
- X+ * May 1991
- X+ *
- X+ * %W% %G%
- X+ *
- X+ */
- X+
- X+ #include "fig.h"
- X+ #include "resources.h"
- X+ #include "alloc.h"
- X+ #include "func.h"
- X+ #include "object.h"
- X+ #include "paintop.h"
- X+ #include "zoom.h"
- X+
- X+ extern (*canvas_kbd_proc)();
- X+ extern (*canvas_locmove_proc)();
- X+ extern (*canvas_leftbut_proc)();
- X+ extern (*canvas_middlebut_proc)();
- X+ extern (*canvas_rightbut_proc)();
- X+ extern null_proc();
- X+ extern set_popupmenu();
- X+ extern int CANVAS_WIDTH, CANVAS_HEIGHT;
- X+
- X+ static int do_pan_left();
- X+ static int do_pan_middle();
- X+ static int do_pan_right();
- X+
- X+ pan_canvas_selected()
- X+ {
- X+ canvas_kbd_proc = null_proc;
- X+ canvas_locmove_proc = null_proc;
- X+ canvas_leftbut_proc = do_pan_left;
- X+ canvas_middlebut_proc = do_pan_middle;
- X+ canvas_rightbut_proc = do_pan_right;
- X+ set_cursor(&arrow_cursor);
- X+ reset_action_on();
- X+ }
- X+
- X+ static do_pan_left(x,y)
- X+ int x,y;
- X+ {
- X+ zoomxoff=x;
- X+ zoomyoff=y;
- X+ setup_rulers();
- X+ redisplay_rulers();
- X+ setup_grid(0);
- X+ }
- X+
- X+ static do_pan_middle(x,y)
- X+ int x,y;
- X+ {
- X+ zoomxoff=x-CANVAS_WIDTH/2/zoomscale;
- X+ zoomyoff=y-CANVAS_HEIGHT/2/zoomscale;
- X+ if (zoomxoff<0) zoomxoff=0;
- X+ if (zoomyoff<0) zoomyoff=0;
- X+ setup_rulers();
- X+ redisplay_rulers();
- X+ setup_grid(0);
- X+ }
- X+
- X+ static do_pan_right(x,y)
- X+ int x,y;
- X+ {
- X+ zoomxoff=x-CANVAS_WIDTH/zoomscale;
- X+ zoomyoff=y-CANVAS_HEIGHT/zoomscale;
- X+ if (zoomxoff<0) zoomxoff=0;
- X+ if (zoomyoff<0) zoomyoff=0;
- X+ setup_rulers();
- X+ redisplay_rulers();
- X+ setup_grid(0);
- X+ }
- X+
- X+ pan_origin()
- X+ {
- X+ zoomxoff=0;
- X+ zoomyoff=0;
- X+ setup_rulers();
- X+ redisplay_rulers();
- X+ setup_grid(0);
- X+ /* pan_canvas_selected();*/
- X+ }
- X*** @xfig.pl9/panel.c Mon Aug 13 11:13:57 1990
- X--- panel.c Fri Jun 14 11:25:52 1991
- X***************
- X*** 24,30 ****
- X extern change_directory();
- X extern print_wdir();
- X extern print_figure();
- X! extern finish_text_input();
- X extern int line_thickness;
- X extern int cur_radius;
- X extern int cur_areafill;
- X--- 24,33 ----
- X extern change_directory();
- X extern print_wdir();
- X extern print_figure();
- X! extern save_finish_text_input();
- X! extern int cur_command;
- X! extern int rotate_angle;
- X! extern int flip_axis;
- X extern int line_thickness;
- X extern int cur_radius;
- X extern int cur_areafill;
- X***************
- X*** 39,44 ****
- X--- 42,48 ----
- X extern int cur_printer;
- X extern char *printer_list[];
- X extern TOOL fontmenu; /* popup menu for printer fonts */
- X+ extern int cur_command;
- X extern appresStruct appres;
- X extern int font_button; /* "current" font */
- X extern int *font_sel; /* pointer to store font selected from popup */
- X***************
- X*** 88,99 ****
- X--- 92,106 ----
- X static Pixmap print_sel_pm; /* pixmap for printer selection widget */
- X static Pixmap font_size_pm; /* pixmap for printer selection widget */
- X static Pixmap font_step_pm; /* pixmap for text step widget */
- X+ static Pixmap zoom_pm; /* pixmap for zoom widget */
- X static Pixmap text_just_pm[3]; /* pixmaps for left/center/right just widget */
- X static Widget print_sel_widget;
- X static Widget font_size_widget;
- X static Widget font_step_widget;
- X+ static Widget zoom_widget;
- X static F_switch *text_just_sw; /* text justification button */
- X static F_switch *land_port_sw; /* landscape/portrait button */
- X+ static F_switch *zoom_sw;
- X
- X TOOL ind_box; /* allow main() to access this widget */
- X
- X***************
- X*** 146,162 ****
- X { 1, 3, 0, 0, &solidline_ic, F_SET_SOLID_LINE, set_style, null_proc, S_ON, },
- X { 0, 3, 0, 0, &dashline_ic, F_SET_DASH_LINE, set_style, null_proc, S_ON, },
- X { 0, 3, 0, 0, &dottedline_ic, F_SET_DOTTED_LINE, set_style, null_proc, S_ON, },
- X! { 0, 1, 0, 0, &grid1_ic, F_GRID1, set_grid, set_grid, S_TOG, },
- X { 0,-1, 0, 0, &backarrow_ic, F_AUTOB_ARROW, mode_on, mode_off, S_TOG, },
- X { 0,-1, 0, 0, &forarrow_ic, F_AUTOF_ARROW, mode_on, mode_off, S_TOG, },
- X! { 0, 1, 0, 0, &grid2_ic, F_GRID2, set_grid, set_grid, S_TOG, },
- X #ifdef TFX
- X { 0,-1, 0, 0, &fill_ic, F_FILL, mode_on, mode_off, S_TOG, },
- X! { 1,-1, 0, 0, &magnet_ic, F_MAGNET, mode_on, mode_off, S_TOG, },
- X #else
- X! { 1,-1, 0, 0, &magnet_ic, F_MAGNET, mode_on, mode_off, S_TOG, },
- X { 0,-1, 0, 0, &fill_ic, F_FILL, mode_on, mode_off, S_TOG, },
- X #endif
- X { 0,-1, 0, 0, &incdec_thick_ic, F_INCDECTHICK, dec_thick, null_proc, S_MOMENT,},
- X #ifndef TFX
- X { 0,-1, 0, 0, &incdec_radius_ic, F_INCDECRADIUS, dec_radius, null_proc, S_MOMENT,},
- X--- 153,175 ----
- X { 1, 3, 0, 0, &solidline_ic, F_SET_SOLID_LINE, set_style, null_proc, S_ON, },
- X { 0, 3, 0, 0, &dashline_ic, F_SET_DASH_LINE, set_style, null_proc, S_ON, },
- X { 0, 3, 0, 0, &dottedline_ic, F_SET_DOTTED_LINE, set_style, null_proc, S_ON, },
- X! { 0, 1 , 0, 0, &grid1_ic, F_GRID1, mode_on, mode_off, S_TOG, },
- X { 0,-1, 0, 0, &backarrow_ic, F_AUTOB_ARROW, mode_on, mode_off, S_TOG, },
- X { 0,-1, 0, 0, &forarrow_ic, F_AUTOF_ARROW, mode_on, mode_off, S_TOG, },
- X! { 0, 1 , 0, 0, &grid2_ic, F_GRID2, mode_on, mode_off, S_TOG, },
- X! { 1,-1, 0, 0, &magnet_ic, F_MAGNET, mode_on, mode_off, S_TOG, },
- X #ifdef TFX
- X+ { 0, 0, 0, 0, &zoom_ic, F_ZOOM, set_command, null_proc, S_ON,},
- X+ { 0,-1, 0, 0, &blank_ic, F_NOP, null_proc, null_proc, S_MOMENT, },
- X { 0,-1, 0, 0, &fill_ic, F_FILL, mode_on, mode_off, S_TOG, },
- X! { 0, 0, 0, 0, &pan_ic, F_PAN, set_command, null_proc, S_ON,},
- X #else
- X! { 0,-1, 0, 0, &blank_ic, F_NOP, null_proc, null_proc, S_MOMENT, },
- X! { 0, 0, 0, 0, &zoom_ic, F_ZOOM, set_command, null_proc, S_ON,},
- X! { 0, 0, 0, 0, &pan_ic, F_PAN, set_command, null_proc, S_ON,},
- X { 0,-1, 0, 0, &fill_ic, F_FILL, mode_on, mode_off, S_TOG, },
- X #endif
- X+
- X { 0,-1, 0, 0, &incdec_thick_ic, F_INCDECTHICK, dec_thick, null_proc, S_MOMENT,},
- X #ifndef TFX
- X { 0,-1, 0, 0, &incdec_radius_ic, F_INCDECRADIUS, dec_radius, null_proc, S_MOMENT,},
- X***************
- X*** 406,411 ****
- X--- 419,430 ----
- X sw->icon->width, sw->icon->height,fg,bg,
- X DefaultDepthOfScreen(s));
- X
- X+ if (sw->value == F_ZOOM) /* save pointer to pixmap/widget for zoom */
- X+ {
- X+ zoom_pm = p;
- X+ zoom_widget = sw->but.widget;
- X+ zoom_sw=sw;
- X+ }
- X sw->but.normal = button_args[3].value = (XtArgVal)p;
- X XtSetValues(sw->but.widget, &button_args[3], 1);
- X }
- X***************
- X*** 538,543 ****
- X--- 557,572 ----
- X case F_STEP:
- X inc_step_button(sw);
- X break;
- X+ case F_ZOOM:
- X+ /* turn_off_old_switch();
- X+ turn_on(sw);*/
- X+ zoom_scale_1();
- X+ break;
- X+ case F_PAN:
- X+ /*turn_off_old_switch();
- X+ turn_on(sw);*/
- X+ pan_origin();
- X+ break;
- X }
- X }
- X
- X***************
- X*** 646,657 ****
- X set_command(sw)
- X F_switch *sw;
- X {
- X- extern int cur_command;
- X- extern int rotate_angle;
- X- extern int flip_axis;
- X-
- X if (cur_command == F_TEXT)
- X! finish_text_input(); /* finish up any text input */
- X switch (sw->value) {
- X case F_CIRCLE_BY_RAD :
- X circlebyradius_drawing_selected();
- X--- 675,682 ----
- X set_command(sw)
- X F_switch *sw;
- X {
- X if (cur_command == F_TEXT)
- X! save_finish_text_input(); /* finish up any text input */
- X switch (sw->value) {
- X case F_CIRCLE_BY_RAD :
- X circlebyradius_drawing_selected();
- X***************
- X*** 839,846 ****
- X show_compoundbox();
- X put_msg("CHANGE OBJECT");
- X break;
- X!
- X!
- X }
- X cur_command = sw->value;
- X }
- X--- 864,881 ----
- X show_compoundbox();
- X put_msg("CHANGE OBJECT");
- X break;
- X! case F_PAN:
- X! pan_canvas_selected();
- X! erase_pointmarker();
- X! erase_compoundbox();
- X! put_msg("Click: left button=new upper left, middle button=new center");
- X! break;
- X! case F_ZOOM:
- X! zoom_canvas_selected();
- X! erase_pointmarker();
- X! erase_compoundbox();
- X! put_msg("Click: left button=define zoom rectangle, middle button=unzoom one step");
- X! break;
- X }
- X cur_command = sw->value;
- X }
- X***************
- X*** 914,919 ****
- X--- 949,955 ----
- X extern int autoforwardarrow_mode;
- X extern int autobackwardarrow_mode;
- X extern int magnet_mode;
- X+ extern int grid2_mode;
- X
- X switch (sw->value) {
- X case F_AUTOF_ARROW :
- X***************
- X*** 927,933 ****
- X case F_MAGNET :
- X magnet_mode = 1;
- X put_msg("MAGNET: round entered points to the nearest %s increment",
- X! (appres.INCHES? "1/16\"": "2 mm"));
- X break;
- X case F_FILL :
- X fill_mode = 1;
- X--- 963,969 ----
- X case F_MAGNET :
- X magnet_mode = 1;
- X put_msg("MAGNET: round entered points to the nearest %s increment",
- X! (appres.INCHES? "1/16\"": (grid2_mode? "5mm":"1mm")));
- X break;
- X case F_FILL :
- X fill_mode = 1;
- X***************
- X*** 934,939 ****
- X--- 970,985 ----
- X put_fmsg("FILL MODE (gray level = %.2lf)",
- X (double)1.0-(cur_areafill-1.0)/(NUMFILLPATS-1.0));
- X break;
- X+ case F_GRID1 :
- X+ grid2_mode = 0;
- X+ setup_grid(sw->value);
- X+ put_msg("GRID1 on");
- X+ break;
- X+ case F_GRID2 :
- X+ grid2_mode = 1;
- X+ setup_grid(sw->value);
- X+ put_msg("GRID2 on");
- X+ break;
- X }
- X }
- X
- X***************
- X*** 944,949 ****
- X--- 990,996 ----
- X extern int autoforwardarrow_mode;
- X extern int autobackwardarrow_mode;
- X extern int magnet_mode;
- X+ extern int grid2_mode;
- X
- X switch (sw->value) {
- X case F_AUTOF_ARROW :
- X***************
- X*** 959,964 ****
- X--- 1006,1020 ----
- X fill_mode = 0;
- X put_msg("NO-FILL MODE");
- X break;
- X+ case F_GRID1 :
- X+ setup_grid(sw->value);
- X+ put_msg("NO GRID");
- X+ break;
- X+ case F_GRID2 :
- X+ grid2_mode = 0;
- X+ setup_grid(sw->value);
- X+ put_msg("NO GRID");
- X+ break;
- X }
- X }
- X
- X***************
- X*** 1022,1033 ****
- X /* erase by drawing wide, inverted (white) line */
- X pw_vector(line_pm, 0, SWITCH_ICON_HEIGHT/2,
- X SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, ERASE,
- X! SWITCH_ICON_HEIGHT, SOLID_LINE, 0.0);
- X /* draw current line thickness into pixmap */
- X if (line_thickness > 0) /* don't draw line for zero-thickness */
- X pw_vector(line_pm, 0, SWITCH_ICON_HEIGHT/2,
- X SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, PAINT,
- X! line_thickness, SOLID_LINE, 0.0);
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X--- 1078,1089 ----
- X /* erase by drawing wide, inverted (white) line */
- X pw_vector(line_pm, 0, SWITCH_ICON_HEIGHT/2,
- X SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, ERASE,
- X! SWITCH_ICON_HEIGHT, PANEL_LINE, 0.0);
- X /* draw current line thickness into pixmap */
- X if (line_thickness > 0) /* don't draw line for zero-thickness */
- X pw_vector(line_pm, 0, SWITCH_ICON_HEIGHT/2,
- X SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, PAINT,
- X! line_thickness, PANEL_LINE, 0.0);
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X***************
- X*** 1078,1089 ****
- X /* erase by drawing wide, inverted (white) line */
- X pw_vector(radius_pm, 0, SWITCH_ICON_HEIGHT/2,
- X SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, ERASE,
- X! SWITCH_ICON_HEIGHT, SOLID_LINE, 0.0);
- X /* draw current radius into pixmap */
- X curve(radius_pm, 0, cur_radius, cur_radius, 0, 0,
- X cur_radius, cur_radius,
- X 1, SWITCH_ICON_HEIGHT-2, foreground_color,
- X! 1, SOLID_LINE, 0.0, 0);
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X--- 1134,1145 ----
- X /* erase by drawing wide, inverted (white) line */
- X pw_vector(radius_pm, 0, SWITCH_ICON_HEIGHT/2,
- X SWITCH_ICON_WIDTH, SWITCH_ICON_HEIGHT/2, ERASE,
- X! SWITCH_ICON_HEIGHT, PANEL_LINE, 0.0);
- X /* draw current radius into pixmap */
- X curve(radius_pm, 0, cur_radius, cur_radius, 0, 0,
- X cur_radius, cur_radius,
- X 1, SWITCH_ICON_HEIGHT-2, foreground_color,
- X! 1, PANEL_LINE, 0.0, 0);
- X
- X /* Fool the toolkit by changing the background pixmap to 0
- X then giving it the modified one again. Otherwise, it sees
- X***************
- X*** 1367,1373 ****
- X /* could make this more generic - but a copy will do for font set JNT */
- X show_textstep()
- X {
- X! put_msg("Font step %.1f",step_button / 10.0);
- X /* write the font size in the background pixmap */
- X tmpsiz[0]=tmpsiz[1]=tmpsiz[2]=tmpsiz[3]=tmpsiz[4]='\0';
- X sprintf(tmpsiz,"%3.1f",step_button / 10.0);
- X--- 1423,1429 ----
- X /* could make this more generic - but a copy will do for font set JNT */
- X show_textstep()
- X {
- X! put_fmsg("Font step %.1f",(double) step_button / 10.0);
- X /* write the font size in the background pixmap */
- X tmpsiz[0]=tmpsiz[1]=tmpsiz[2]=tmpsiz[3]=tmpsiz[4]='\0';
- X sprintf(tmpsiz,"%3.1f",step_button / 10.0);
- X***************
- X*** 1465,1468 ****
- X--- 1521,1562 ----
- X turn_off(sw);
- X off_action(sw);
- X }
- X+ }
- X+
- X+
- X+ /* change active switch - used for some right-button functions */
- X+ static turn_off_old_switch(sw)
- X+ F_switch *sw;
- X+ {
- X+ F_switch *old;
- X+ old = group[sw->group];
- X+ if (old != sw && old)
- X+ { turn_off(old);
- X+ off_action(old);
- X+ }
- X+ }
- X+
- X+
- X+ show_zoomscale()
- X+ {
- X+ /* write the font size in the background pixmap */
- X+ tmpsiz[0]=tmpsiz[1]=tmpsiz[2]=tmpsiz[3]=tmpsiz[4]='\0';
- X+ sprintf(tmpsiz,"%1d",zoomscale);
- X+ /* put zoom scale number in normal and inverted pixmap */
- X+ XDrawImageString(tool_d, zoom_sw->but.normal, button_gc,
- X+ 2, 25, tmpsiz, strlen(tmpsiz));
- X+ XDrawImageString(tool_d, zoom_sw->but.reverse, button_gc,
- X+ 2, 25, tmpsiz, strlen(tmpsiz));
- X+
- X+ /* Fool the toolkit by changing the background pixmap to 0
- X+ then giving it the modified one again. Otherwise, it sees
- X+ that the pixmap ID is not changed and doesn't actually draw
- X+ it into the widget window */
- X+ button_args[3].value = 0;
- X+ XtSetValues(zoom_widget, &button_args[3], 1);
- X+
- X+ /* put the pixmap in the widget background */
- X+ button_args[3].value =
- X+ zoom_sw->on ? zoom_sw->but.reverse : zoom_sw->but.normal;
- X+ XtSetValues(zoom_widget, &button_args[3], 1);
- X }
- X*** @xfig.pl9/xtra.c Mon Jun 4 15:48:36 1990
- X--- xtra.c Fri Jun 14 10:44:30 1991
- X***************
- X*** 12,17 ****
- X--- 12,18 ----
- X #include "paintop.h"
- X #include "font.h"
- X #include "object.h"
- X+ #include "zoom.h"
- X
- X extern int gc_thickness[0x10], gc_line_style[0x10];
- X
- X***************
- X*** 31,37 ****
- X gc_font[op] = font;
- X gc_fontsize[op] = size;
- X }
- X! XDrawString(tool_d, w, gccache[op], x, y, string, strlen(string));
- X }
- X
- X pr_size
- X--- 32,38 ----
- X gc_font[op] = font;
- X gc_fontsize[op] = size;
- X }
- X! zXDrawString(tool_d, w, gccache[op], x, y, string, strlen(string));
- X }
- X
- X pr_size
- X***************
- X*** 46,52 ****
- X canvas_font = lookfont(font,size); /* make sure it is the right font */
- X XTextExtents(canvas_font, s, n, &dummy, &dummy, &dummy, &ch);
- X ret.x = ch.width;
- X! ret.y = ch.ascent + ch.descent;
- X return (ret);
- X }
- X
- X--- 47,53 ----
- X canvas_font = lookfont(font,size); /* make sure it is the right font */
- X XTextExtents(canvas_font, s, n, &dummy, &dummy, &dummy, &ch);
- X ret.x = ch.width;
- X! ret.y = (ch.ascent + ch.descent);
- X return (ret);
- X }
- X
- X***************
- X*** 380,386 ****
- X if (line_width == 0)
- X return;
- X set_line_stuff(line_width,line_style,style_val,op);
- X! XDrawLine(tool_d, w, gccache[op], x1, y1, x2, y2);
- X }
- X
- X pw_lines(w, points, npoints, op, line_width, line_style, style_val, area_fill)
- X--- 381,390 ----
- X if (line_width == 0)
- X return;
- X set_line_stuff(line_width,line_style,style_val,op);
- X! if (line_style==PANEL_LINE)
- X! XDrawLine(tool_d, w, gccache[op], x1, y1, x2, y2);
- X! else
- X! zXDrawLine(tool_d, w, gccache[op], x1, y1, x2, y2);
- X }
- X
- X pw_lines(w, points, npoints, op, line_width, line_style, style_val, area_fill)
- X***************
- X*** 399,411 ****
- X gc = fill_gc[area_fill-1];
- X else
- X gc = un_fill_gc[area_fill-1];
- X! XFillPolygon(tool_d, w, gc, points, npoints,
- X Complex, CoordModeOrigin);
- X }
- X if (line_width == 0)
- X return;
- X set_line_stuff(line_width, line_style, style_val, op);
- X! XDrawLines(tool_d, w, gccache[op], points, npoints, CoordModeOrigin);
- X }
- X
- X set_line_stuff(width,style,style_val,op)
- X--- 403,422 ----
- X gc = fill_gc[area_fill-1];
- X else
- X gc = un_fill_gc[area_fill-1];
- X! if (line_style==PANEL_LINE)
- X! XFillPolygon(tool_d, w, gc, points, npoints,
- X Complex, CoordModeOrigin);
- X+ else
- X+ zXFillPolygon(tool_d, w, gc, points, npoints,
- X+ Complex, CoordModeOrigin);
- X }
- X if (line_width == 0)
- X return;
- X set_line_stuff(line_width, line_style, style_val, op);
- X! if (line_style==PANEL_LINE)
- X! XDrawLines(tool_d, w, gccache[op], points, npoints, CoordModeOrigin);
- X! else
- X! zXDrawLines(tool_d, w, gccache[op], points, npoints, CoordModeOrigin);
- X }
- X
- X set_line_stuff(width,style,style_val,op)
- X***************
- X*** 414,437 ****
- X {
- X XGCValues gcv;
- X unsigned long mask;
- X! char dash_list[2];
- X
- X! if (width == gc_thickness[op] && style == gc_line_style[op])
- X! return;
- X! gcv.line_width = (width == 1? 0: width); /* use 0 width for 1 (much faster) */
- X! mask = GCLineWidth|GCLineStyle;
- X! gcv.line_style = (style==SOLID_LINE)? LineSolid: LineOnOffDash;
- X! if (style==SOLID_LINE)
- X! XChangeGC(tool_d, gccache[op], mask, &gcv);
- X! else
- X {
- X- mask |= GCDashList;
- X if (style_val > 0.0) /* style_val of 0.0 causes problems */
- X {
- X- gcv.dashes = (char) style_val;
- X- XChangeGC(tool_d, gccache[op], mask, &gcv);
- X /* length of ON/OFF pixels */
- X! dash_list[0]=dash_list[1] = (char) style_val;
- X if (style == DOTTED_LINE)
- X dash_list[0] = 1; /* length of ON pixels for dotted */
- X XSetDashes(tool_d, gccache[op], 0, dash_list, 2);
- X--- 425,460 ----
- X {
- X XGCValues gcv;
- X unsigned long mask;
- X! static char dash_list[2]={-1,-1};
- X
- X! switch(style)
- X! { case RUBBER_LINE: width=1;
- X! break;
- X! case PANEL_LINE: break;
- X! default: width=zoomscale*width;
- X! break;
- X! }
- X!
- X! /* see if all gc stuff is already correct */
- X! if (width == gc_thickness[op] && style == gc_line_style[op] &&
- X! (style!=DASH_LINE && style!=DOTTED_LINE ||
- X! dash_list[1]==(char)style_val*zoomscale ) )
- X! return; /* yes, no need to change it */
- X!
- X! /* can't use linewidth 0 when setting dashed lines! */
- X! gcv.line_width=width;
- X!
- X! mask = GCLineWidth|GCLineStyle|GCCapStyle;
- X! gcv.line_style = (style==DASH_LINE || style==DOTTED_LINE)?
- X! LineOnOffDash : LineSolid;
- X! gcv.cap_style= (style==DOTTED_LINE)? CapRound : CapButt;
- X! XChangeGC(tool_d, gccache[op], mask, &gcv);
- X! if (style==DASH_LINE || style==DOTTED_LINE)
- X {
- X if (style_val > 0.0) /* style_val of 0.0 causes problems */
- X {
- X /* length of ON/OFF pixels */
- X! dash_list[0]=dash_list[1] = (char) style_val*zoomscale;
- X if (style == DOTTED_LINE)
- X dash_list[0] = 1; /* length of ON pixels for dotted */
- X XSetDashes(tool_d, gccache[op], 0, dash_list, 2);
- END_OF_FILE
- if test 53127 -ne `wc -c <'patch10.4'`; then
- echo shar: \"'patch10.4'\" unpacked with wrong size!
- fi
- # end of 'patch10.4'
- fi
- echo shar: End of archive 4 \(of 4\).
- cp /dev/null ark4isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- --
- Dan Heller
- O'Reilly && Associates Z-Code Software Comp-sources-x:
- Senior Writer President comp-sources-x@uunet.uu.net
- argv@ora.com argv@zipcode.com
-